var myCodeMirror = null;
var editor = null;
loadjsfile("js/custom.js", "js");
window.onload = function(){
	console.log("Welcome to Lithium Editor!");
	editor = document.getElementById("code");
	myCodeMirror = CodeMirror.fromTextArea(editor,defaults);
};
function loadjsfile(filename, filetype){
	if (filetype==="js"){ //if filename is a external JavaScript file
		var fileref=document.createElement('script');
		fileref.setAttribute("type","text/javascript");
		fileref.setAttribute("src", filename);
	}
	if (typeof fileref!="undefined"){
		document.getElementsByTagName("head")[0].appendChild(fileref);
	}
};